#include "XobjIO.h"
#include "glMesh.h"
#include "glWorld.h"

#include "../glew/glew.h"
#include "../glut/glut.h"

std::vector<CXobjIO *> g_vMyXobj;

int main(int argc, char ** argv)
{
    glutInit( &argc, argv );    
    glutInitWindowSize(800, 600);    
    glutInitWindowPosition(0, 0);
    glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH);
  
    glutCreateWindow(argv[0]);

    glewInit();

	char * fname = "..\\Media\\models\\cubes.XOBJ";
    if (CXobjIO::Load(g_vMyXobj, fname ) != XOBJ_OK)
		printf("File loading failed!\n");
	else
    printf("File loading finished successfully. g_vMyXobj.size() = %d\n", g_vMyXobj.size());

  CglMesh *pMesh = new CglMesh(g_vMyXobj[0][0]);

	delete pMesh;

	CglWorld glWorld;

	glWorld.Create(&g_vMyXobj[0], (uint32)g_vMyXobj.size());

	return 0;
}